/**
 * Vuex（store缓存）
 */
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);
const store = new Vuex.Store({
  state: {
    currentUserInfo: {},
  },
  mutations: {
    handleCurrentUserInfo(state, res) {
      state.currentUserInfo = res;
    },
  },
  actions: {
    updateCurrentUserInfo({
      commit,
    }, res) {
      commit('handleCurrentUserInfo', res);
    },
  },
});

export default store;
